package ch05_类与对象;

public class Person1 {
	String name;
	int age = 20;
	String id;
	String getName(){
		return name;
	}
	int getAge() {
		return age;
	}
	void setAge(int newAge) {
		age=newAge;
	}
	void sleep(int time) {
		System.out.println("睡了 "+time+" 年...");
	}
	public static void main(String[] args) {
		Person1 person=new Person1();
		person.setAge(100);
		System.out.println("创建了一个对象:"+person.age+"岁");
		person.sleep(100);
	}
}
